﻿using Castle.MicroKernel.Registration;
using Castle.MicroKernel.SubSystems.Configuration;
using Castle.Windsor;
using Yto.Common.Configuration;
using Yto.Common.Dependency;
using Yto.Modules;
using Yto.Reflection;
using Yto.Repositories;

namespace Yto
{
    public class CtnIntaller : IWindsorInstaller
    {
        public void Install(IWindsorContainer container, IConfigurationStore store)
        {
            container.Register(
                //Component.For<CtnManager, ICtnManager, ICtnRegister, ICtnResolver>().UsingFactoryMethod(() => CtnManager.Instance).LifestyleSingleton(),
                Component.For<IModuleManager>().ImplementedBy<ModuleManager>().LifestyleSingleton(),
                Component.For<IAssemblyFinder>().ImplementedBy<AssemblyFinder>().LifestyleSingleton(),
                Component.For<ITypeFinder,TypeFinder>().ImplementedBy<TypeFinder>().LifestyleSingleton(),
                Component.For<IRegistRepositories>().ImplementedBy<RegistRepositories>().LifestyleSingleton(),
                Component.For<IStartupConfiguration,StartupConfiguration>().ImplementedBy<StartupConfiguration>().LifestyleSingleton()
            );
        }
    }
}
